<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GimpColorSpace: GIMP 3 Color Library Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GIMP 3 Color Library Reference Manual">
<link rel="up" href="pt01.html" title="Part I. GIMP Color Library">
<link rel="prev" href="libgimpcolor3-GimpCMYK.html" title="GimpCMYK">
<link rel="next" href="GimpColorManaged.html" title="GimpColorManaged">
<meta name="generator" content="GTK-Doc V1.33.0 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#libgimpcolor3-GimpColorSpace.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="pt01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="libgimpcolor3-GimpCMYK.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GimpColorManaged.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="libgimpcolor3-GimpColorSpace"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libgimpcolor3-GimpColorSpace.top_of_page"></a>GimpColorSpace</span></h2>
<p>GimpColorSpace — Utility functions which convert colors between
different color models.</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="libgimpcolor3-GimpColorSpace.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="libgimpcolor3-GimpColorSpace.html#gimp-rgb-to-hsv" title="gimp_rgb_to_hsv ()">gimp_rgb_to_hsv</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="libgimpcolor3-GimpColorSpace.html#gimp-rgb-to-hsl" title="gimp_rgb_to_hsl ()">gimp_rgb_to_hsl</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="libgimpcolor3-GimpColorSpace.html#gimp-rgb-to-cmyk" title="gimp_rgb_to_cmyk ()">gimp_rgb_to_cmyk</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="libgimpcolor3-GimpColorSpace.html#gimp-hsv-to-rgb" title="gimp_hsv_to_rgb ()">gimp_hsv_to_rgb</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="libgimpcolor3-GimpColorSpace.html#gimp-hsl-to-rgb" title="gimp_hsl_to_rgb ()">gimp_hsl_to_rgb</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="libgimpcolor3-GimpColorSpace.html#gimp-cmyk-to-rgb" title="gimp_cmyk_to_rgb ()">gimp_cmyk_to_rgb</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libgimpcolor3-GimpColorSpace.description"></a><h2>Description</h2>
<p>When programming pixel data manipulation functions you will often
use algorithms operating on a color model different from the one
GIMP uses.  This file provides utility functions to convert colors
between different color spaces.</p>
</div>
<div class="refsect1">
<a name="libgimpcolor3-GimpColorSpace.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gimp-rgb-to-hsv"></a><h3>gimp_rgb_to_hsv ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gimp_rgb_to_hsv (<em class="parameter"><code>const <a class="link" href="libgimpcolor3-GimpRGB.html#GimpRGB" title="struct GimpRGB"><span class="type">GimpRGB</span></a> *rgb</code></em>,
                 <em class="parameter"><code><a class="link" href="libgimpcolor3-GimpHSV.html#GimpHSV" title="struct GimpHSV"><span class="type">GimpHSV</span></a> *hsv</code></em>);</pre>
<p>Does a conversion from RGB to HSV (Hue, Saturation,
Value) colorspace.</p>
<div class="refsect3">
<a name="gimp-rgb-to-hsv.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>rgb</p></td>
<td class="parameter_description"><p>A color value in the RGB colorspace</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>hsv</p></td>
<td class="parameter_description"><p>The value converted to the HSV colorspace. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Out parameter, where caller must allocate storage."><span class="acronym">out caller-allocates</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gimp-rgb-to-hsl"></a><h3>gimp_rgb_to_hsl ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gimp_rgb_to_hsl (<em class="parameter"><code>const <a class="link" href="libgimpcolor3-GimpRGB.html#GimpRGB" title="struct GimpRGB"><span class="type">GimpRGB</span></a> *rgb</code></em>,
                 <em class="parameter"><code><a class="link" href="libgimpcolor3-GimpHSV.html#GimpHSL" title="struct GimpHSL"><span class="type">GimpHSL</span></a> *hsl</code></em>);</pre>
<p>Convert an RGB color value to a HSL (Hue, Saturation, Lightness)
color value.</p>
<div class="refsect3">
<a name="gimp-rgb-to-hsl.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>rgb</p></td>
<td class="parameter_description"><p>A color value in the RGB colorspace</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>hsl</p></td>
<td class="parameter_description"><p>The value converted to HSL. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Out parameter, where caller must allocate storage."><span class="acronym">out caller-allocates</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gimp-rgb-to-cmyk"></a><h3>gimp_rgb_to_cmyk ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gimp_rgb_to_cmyk (<em class="parameter"><code>const <a class="link" href="libgimpcolor3-GimpRGB.html#GimpRGB" title="struct GimpRGB"><span class="type">GimpRGB</span></a> *rgb</code></em>,
                  <em class="parameter"><code><span class="type">gdouble</span> pullout</code></em>,
                  <em class="parameter"><code><a class="link" href="libgimpcolor3-GimpCMYK.html#GimpCMYK" title="struct GimpCMYK"><span class="type">GimpCMYK</span></a> *cmyk</code></em>);</pre>
<p>Does a naive conversion from RGB to CMYK colorspace. A simple
formula that doesn't take any color-profiles into account is used.
The amount of black pullout how can be controlled via the <em class="parameter"><code>pullout</code></em>

parameter. A <em class="parameter"><code>pullout</code></em>
 value of 0 makes this a conversion to CMY.
A value of 1 causes the maximum amount of black to be pulled out.</p>
<div class="refsect3">
<a name="gimp-rgb-to-cmyk.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>rgb</p></td>
<td class="parameter_description"><p>A value in the RGB colorspace</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>pullout</p></td>
<td class="parameter_description"><p>A scaling value (0-1) indicating how much black should be
pulled out</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>cmyk</p></td>
<td class="parameter_description"><p>The input value naively converted
to the CMYK colorspace. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Out parameter, where caller must allocate storage."><span class="acronym">out caller-allocates</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gimp-hsv-to-rgb"></a><h3>gimp_hsv_to_rgb ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gimp_hsv_to_rgb (<em class="parameter"><code>const <a class="link" href="libgimpcolor3-GimpHSV.html#GimpHSV" title="struct GimpHSV"><span class="type">GimpHSV</span></a> *hsv</code></em>,
                 <em class="parameter"><code><a class="link" href="libgimpcolor3-GimpRGB.html#GimpRGB" title="struct GimpRGB"><span class="type">GimpRGB</span></a> *rgb</code></em>);</pre>
<p>Converts a color value from HSV to RGB colorspace</p>
<div class="refsect3">
<a name="gimp-hsv-to-rgb.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>hsv</p></td>
<td class="parameter_description"><p>A color value in the HSV colorspace</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>rgb</p></td>
<td class="parameter_description"><p>The returned RGB value. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Out parameter, where caller must allocate storage."><span class="acronym">out caller-allocates</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gimp-hsl-to-rgb"></a><h3>gimp_hsl_to_rgb ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gimp_hsl_to_rgb (<em class="parameter"><code>const <a class="link" href="libgimpcolor3-GimpHSV.html#GimpHSL" title="struct GimpHSL"><span class="type">GimpHSL</span></a> *hsl</code></em>,
                 <em class="parameter"><code><a class="link" href="libgimpcolor3-GimpRGB.html#GimpRGB" title="struct GimpRGB"><span class="type">GimpRGB</span></a> *rgb</code></em>);</pre>
<p>Convert a HSL color value to an RGB color value.</p>
<div class="refsect3">
<a name="gimp-hsl-to-rgb.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>hsl</p></td>
<td class="parameter_description"><p>A color value in the HSL colorspace</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>rgb</p></td>
<td class="parameter_description"><p>The value converted to a value
in the RGB colorspace. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Out parameter, where caller must allocate storage."><span class="acronym">out caller-allocates</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gimp-cmyk-to-rgb"></a><h3>gimp_cmyk_to_rgb ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gimp_cmyk_to_rgb (<em class="parameter"><code>const <a class="link" href="libgimpcolor3-GimpCMYK.html#GimpCMYK" title="struct GimpCMYK"><span class="type">GimpCMYK</span></a> *cmyk</code></em>,
                  <em class="parameter"><code><a class="link" href="libgimpcolor3-GimpRGB.html#GimpRGB" title="struct GimpRGB"><span class="type">GimpRGB</span></a> *rgb</code></em>);</pre>
<p>Does a simple transformation from the CMYK colorspace to the RGB
colorspace, without taking color profiles into account.</p>
<div class="refsect3">
<a name="gimp-cmyk-to-rgb.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>cmyk</p></td>
<td class="parameter_description"><p>A color value in the CMYK colorspace</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>rgb</p></td>
<td class="parameter_description"><p>The value converted to the RGB colorspace. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Out parameter, where caller must allocate storage."><span class="acronym">out caller-allocates</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.0</div>
</body>
</html>